home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: MegaDisc / MegaDisc 36 (1993-11)(MegaDisc Digital Publishing)(AU)(Disk 2 of 2).zip / MegaDisc 36 (1993-11)(MegaDisc Digital Publishing)(AU)(Disk 2 of 2).adf / ARexx / Modular / Rectangle.mod < prev    next >
Text File  |  1993-08-19  |  2KB  |  36 lines

  1.     /* Rectangles, filled, framed, reccessed, embossed, etc. */
  2.     Rectangle:
  3.      t = 'Enter details as shown, retaining all commas.',
  4.          '\For frame: N = None, R = Recessed, E = Embossed,',
  5.          '\or give just its colour number for a plain frame.',
  6.          '\For the fill colour, no entry (2 adjacent commas)',
  7.          "\means 'Do not fill'."
  8.      u = 'left,top,right,bottom,fill colour,frame'
  9.      s = Request(80,30,t,u,'Okay','Cancel')
  10.      if s ~= '' then do
  11.       parse var s x1 ',' y1 ',' x2 ',' y2 ',' co ',' f .
  12.       select 
  13.         when datatype(f) = 'NUM' then call Plain(x1-2,y1-1,x2+2,y2+1,co)
  14.         when UPPER(f) = 'R' then call Recess(x1-2,y1-1,x2+2,y2+1,co)
  15.         when UPPER(f) = 'E' then call Emboss(x1-2,y1-1,x2+2,y2+1,co)
  16.         otherwise
  17.         end
  18.         if co ~= '' then do
  19.          call SetAPen(HO,co) ; call RectFill(HO,x1,y1,x2,y2) 
  20.          call SetAPen(HO,1) ; end
  21.       end
  22.    return
  23.     
  24.     Plain: ; parse arg lf,up,rt,bot . ; call Rect(lf,up,rt,bot,f,f); return    
  25.     Emboss: ;parse arg lf,up,rt,bot . ; call Rect(lf,up,rt,bot,2,1); return
  26.     Recess: ;parse arg lf,up,rt,bot . ; call Rect(lf,up,rt,bot,1,2); return
  27.     Rect:
  28.      parse arg lf,up,rt,bot,edge1,edge2 . ; call SetAPen(HO,edge1)
  29.      call Move(HO,lf,up) ; call Draw(HO,rt,up)    
  30.      call SetAPen(HO,edge2) ; call Move(HO,lf,bot) ; call Draw(HO,rt,bot)     
  31.      do u = 0 to 1 ; call Move(HO,rt-u,up+u) ; call Draw(HO,rt-u,bot) ; end 
  32.      call SetAPen(HO,edge1)
  33.      do u = 0 to 1 ; call Move(HO,lf+u,bot-u) ; call Draw(HO,lf+u,up) ; end 
  34.      call SetAPen(HO,1)
  35.      return
  36.